//
//  BaseNavViewController.swift
//  Weibo
//
//  Created by 周先生 on 15/11/19.
//  Copyright © 2015年 周先生. All rights reserved.
//

import UIKit

class BaseNavViewController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    override func pushViewController(viewController: UIViewController, animated: Bool) {
        if self.childViewControllers.count != 0 {
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "返回", style: .Plain, target: self, action: "back")
            viewController.hidesBottomBarWhenPushed = true
        }
        super.pushViewController(viewController, animated: animated)
    }
    @objc private func back() {
    navigationController?.popViewControllerAnimated(true)
    
    }

}
